<template>
	<view>
		<view class="btitle" :style="{background: 'url(' + list[0].cover_image_url + ')'}">
			<view> {{list[0].title}} </view>
			<view>
				{{list[0].description}} 
			</view>
		</view>
		
		<view class="tjCon">
			<view class="item" v-for="item in list" :key="item.id"  @click="goDesails(item.id)">
				<image :src="item.cover_image_url" alt=""  mode="" />
				<view class="txt">
					<view class="t1">
						{{item.title}}
					</view>
					<view class="info">
						{{item.description}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[]
			}
		},
		
		onLoad(options) {
			let tagId = options.id
			uni.showLoading({
				title:'加载中...'
			})
			uni.request({
				url:'/node_dpc/v2/mweb/ugc/popularity_rank/topics?diffServerTimestamp=1615824259661&tag_id='+tagId,
				success: (res) => {
					uni.hideLoading()
					console.log(res)
					this.list = res.data.data.topics
				}
			})
		},
		
		// ifdef APP-PLUS
			onLoad(options) {
				let tagId = options.id
				uni.showLoading({
					title:'加载中...'
				})
				uni.request({
					url:'/node_dpc/v2/mweb/ugc/popularity_rank/topics?diffServerTimestamp=1615824259661&tag_id='+tagId,
					success: (res) => {
						uni.hideLoading()
						console.log(res)
						this.list = res.data.data.topics
					}
				})
			},
		//endif
		
		
		methods: {
			goDesails(id){
				uni.navigateTo({
					url:'../details/details?id=' + id
				})
			}
		}
	}
</script>

<style>
.btitle{
		text-align: center;
		background: url("https://tn1-f2.kkmh.com/image/210708/SPaxABhlC.webp-w750.jpg");
		padding: 4%;
	}
	.btitle view{
		margin-bottom: 4%;
	}
	.btitle view:nth-child(1){
		font-size: 50rpx;
		color: #515151;
		margin-bottom: 4%;
		font-weight: 700;
	}
.btitle view:nth-child(2){
		font-size: 34rpx;
		color: #7a7a7a;
	}
	.btitle view:nth-child(3){
		font-size: 34rpx;
		color: #fff;
	}	
	
	
	
.tjCon{
			display: flex;
			justify-content: space-between;
			flex-wrap: wrap;
			padding: 10px;
		}
		.tjCon .item{
			width: 48%;
			margin-top: 20px;
		}
		.tjCon .item image{
			width: 100%;
			height: 100px;
		}
		.tjCon .item .txt .t1{
			font-size: 14px;
			color: #333;
		}
		.tjCon .item .txt .info{
			font-size: 12px;
			color: #a3a3a3;
			overflow: hidden;
			text-overflow:ellipsis;
			white-space: nowrap;
			margin-top: 3px;
		}
</style>
